package tool.plot

import implicits.Implicits._
import shared.Pojo._
import tool.Pojo._
import tool.Tool
import tool.plot.AllPlot.RPlotB

import java.io.File


/**
 * Created by yz on 27/9/2020
 */
object CorNetwork extends CorNetworkT with RPlotB {

  def producePlotConfigFile(data: AllPlotData, workspaceDir: File, extraData: ExtraDataData) = {
   data.lines().toTxtFile(Tool.getPlotConfigTxtFile(workspaceDir, name))
  }

  override def getCommand(data:AllPlotData,extraData: ExtraDataData): String = {
    s"""
       |""".stripMargin
  }

  override def defaultPlotArg(tmpPlotData: AllPlotData): AllPlotData = {
    val initData=AllPlotData()
    val customColors = initData.color.customColors
    tmpPlotData.copy(
      rowCluster = "T",
      rowClusterMethod = "complete",
      colCluster = "T",
      layout=tmpPlotData.layout.copy(
        width = "0",
        height = "0",
        colClusterMethod = "complete",
      ),
      color = tmpPlotData.color.copy(
        colorsStr = customColors.mkString(":"),
        customColors = customColors,
        naColor = "#808080",
      ),
      yFont = "6",
      xFont = "6",
      font = tmpPlotData.font.copy(
        showRowName = "T",
        yRotate = "0",
        showColName = "T",
        xRotate = "90",
        rowTreeHeight = "10",
        colTreeHeight = "10"
      ),
      legendFont = "12",
      legendTitle = "",
      legendTitleFont = "12"
    )
  }


}

